<template>
	<view class="pagesContent">
		<view class="top">
			<view class="view">
				<view class="title">
					<view class="left"> 未授权软件列表 ( <text style="font-size: 24rpx;color: indianred;">请点击软件授权</text> )
					</view>
				</view>
				<view class="list">
					<uni-row v-if="list_all.length!=0">
						<uni-col :span="6" class="itemSpan" v-for="(item,index) in list_all " :key="index">
							<view class="item">
								<image class="applogo" src="../../static/tab/his.png" mode=""></image>
								<view class="appname"> xxx </view>
							</view>
						</uni-col>
					</uni-row>
					<view class="noData" v-if="list_all.length==0">
						<image class="icon" src="../../static/images/noDataIcon.png" mode=""></image>
						<view class="text"> 暂无app </view>
					</view>

				</view>

			</view>

		</view>
		<view class="foo">
			<view class="view">
				<view class="title">
					<view class="left">已授权软件列表</view>
					<view class="right">
						<view class="btn" v-if="list_success.length!=0">全部扫描</view>
					</view>
				</view>
				<view class="list">
					<uni-row v-if="list_success.length!=0">
						<uni-col :span="6" class="itemSpan" v-for="(item,index) in list_success " :key="index">
							<view class="item">
								<image class="applogo" src="../../static/tab/his.png" mode=""></image>
								<view class="appname"> xxx </view>
							</view>
						</uni-col>
					</uni-row>
					<view class="noData" v-if="list_success.length==0">
						<image class="icon" src="../../static/images/noDataIcon.png" mode=""></image>
						<view class="text"> 暂无app </view>
					</view>
				</view>
			</view>
		</view>
		<authorizationPrompt ref="authorizationPrompt" @scan_confim=" scan_confim"></authorizationPrompt>
	</view>
</template>
<script>
	import {
		mapGetters,
		mapMutations,
		mapActions
	} from 'vuex'
	// #ifdef APP		
	const globalEvent = uni.requireNativePlugin("globalEvent")
	// #endif
	import {
		unique
	} from "../../util/util.js"
	export default {
		data() {
			return {
				list_all: [],
				list_success: [],
			}
		},
		onShow() {
			let this_ = this;
			if (!this.hasLogin) {
				this.goReLaunch("/pages/user/login")
			} else {
				this.$nextTick(() => {
					this.$refs.authorizationPrompt.popupOpen()
				})
			}
		},
		computed: {
			...mapGetters(["hasLogin", "userInfo", "token", "appMessage", "appVipSwitch", ])
		},
		methods: {
			...mapMutations(["updateAccess_token"]),
			...mapActions(["commitGetAppInfo"]),
			scan_confim() {
				console.log("确定扫描")
			}

		}
	}
</script>
<style>
	page {
		background: #f2f2f2;
	}
</style>

<style lang="scss" scoped>
	.top {
		position: fixed;
		left: 0;
		right: 0;
		top: calc(44px + var(--status-bar-height));
		bottom: 50%;
	}

	.foo {
		position: fixed;
		top: 50%;
		left: 0;
		right: 0;
		bottom: 0;
	}

	.top,
	.foo {
		.view {
			position: relative;
			width: 100%;
			height: 100%;

			.title {
				padding: 0 46rpx;
				height: 84rpx;
				background: #ffffff;
				border-bottom: 2rpx solid #f1f1f1;

				.left {
					float: left;
					height: 84rpx;
					line-height: 84rpx;
				}

				.right {
					float: right;
					height: 84rpx;
					display: flex;
					align-items: center;

					.btn {
						width: 168rpx;
						height: 64rpx;
						line-height: 64rpx;
						text-align: center;
						border-radius: 8rpx;
						border: 2rpx solid #2D6AEA;
						color: #2D6AEA;
						font-size: 24rpx;
					}
				}

			}

			.list {
				position: absolute;
				top: 84rpx;
				left: 0;
				right: 0;
				bottom: 0;
				overflow-y: auto;

				.itemSpan {
					height: 188rpx;

					.item {
						width: 188rpx;
						height: 140rpx;
						padding-top: 48rpx;
						margin: 0 auto;

						.applogo {
							width: 94rpx;
							height: 94rpx;
							display: block;
							margin: 0 auto 8rpx;
						}

						.appname {
							width: 188rpx;
							text-align: center;
							font-size: 24rpx;
							overflow: hidden;
							white-space: nowrap;
							text-overflow: ellipsis;
						}
					}
				}

				.noData {
					padding-top: 200rpx;

					.icon {
						width: 232rpx;
						height: 174rpx;
						display: block;
						margin: 0 auto 16rpx;
					}

					.text {
						text-align: center;
						font-size: 24rpx;
						color: #B4B4B4, 100%;
					}
				}
			}
		}





	}
</style>